package com.qp.bookkeeping.business.book.mapper;

import com.qp.bookkeeping.business.book.model.Bo.GroupMember;
import com.qp.bookkeeping.business.book.model.Do.ShareGroupDo;
import com.qp.bookkeeping.business.book.model.Do.UserDo;
import com.qp.bookkeeping.business.book.model.Dto.ShareGroupDto;
import com.qp.bookkeeping.business.book.model.Dto.UserDto;
import com.qp.bookkeeping.business.book.model.req.UpdateUserReq;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author xutianqi
 */
@Mapper
public interface UserMapper {
    /*------------------------------user------------------------------*/
    /**
     * 插入用户
     *
     * @param userDto 账本对象
     */
    List<UserDo> selectUsers(UserDto userDto);

    /**
     * 插入用户
     *
     * @param userDo 用户对象
     */
    void insertUser(UserDo userDo);

    /**
     * 更新用户
     *
     * @param updateUserReq 更新用户请求体
     */
    void updateUser(UpdateUserReq updateUserReq);


    /*------------------------------group------------------------------*/

    /**
     * 查询共享组
     *
     * @param shareGroupDto 共享组查询对象
     * @return
     */
    List<ShareGroupDo> selectGroups(ShareGroupDto shareGroupDto);

    void insertGroup(ShareGroupDo shareGroupDo);

    void updateGroup(ShareGroupDto shareGroupDto);

    void deleteGroup(ShareGroupDo shareGroupDo);

    List<GroupMember> selectGroupAndRole(ShareGroupDto shareGroupDto);
}
